package cn.leaf.calculator.bean;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * cal unit
 *
 * @author 李克国
 * @version 1.0.0
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class CalUnitEntity<T> extends ParamEntity<T> {

    /**
     * 计算单元预处理：公式未解析
     */
    public static final int CAL_PRE = 5;
    /**
     * 计算单元预初始化
     */
    public static final int CAL_INIT = 6;
    /**
     * 计算单元预初始化万完成
     */
    public static final int CAL_INIT_ED = 7;

    /**
     * 计算等待
     */
    public static final int CAL_WAIT = 8;

    /**
     * 计算完成
     */
    public static final int CAL_OVER = 9;

    /**
     * 计算错误
     */
    public static final int CAL_FAIL = 10;


    public CalUnitEntity() {
        super();
        updateState(CAL_PRE);
    }

    public void ok() {
        updateState(CAL_OVER);
    }

    public void fail() {
        updateState(CAL_FAIL);
    }

}
